﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MvcApplication1
{
    public class SQL08 : RAD.LightOne.Web.Security.LightOneMembershipProvider.IQueryStorage
    {
        public string FindUsersByEmail
        {
            get
            {
                return 
@"select Id, Class from 
(select Id, Class, ROW_NUMBER() over (order by username) as RowNumber from Users) PagedUsers
where RowNumber > ({0} * {1}) and RowNumber <= (({0} * {1}) + {1})";
            }
        }

        public string FindUsersByName
        {
            get {

                return 
@"select Id, Class from 
(select Id, Class, ROW_NUMBER() over (order by username) as RowNumber from Users where username like {0}) PagedUsers
where RowNumber > ({1} * {2}) and RowNumber <= (({1} * {2}) + {2})";
            }
        }

        public string GetAllUsers
        {
            get {
                return
@"select Id, Class from 
(select Id, Class, ROW_NUMBER() over (order by username) as RowNumber from Users where email like {0}) PagedUsers
where RowNumber > ({1} * {2}) and RowNumber <= (({1} * {2}) + {2})";
            }
        }
    }
}